﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>Index</title>
    @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery-ui.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
    <script>
        $(document).ready(function () {
            $("#toolMenu").smartFloat();
            var hdjsAlert = $("#e").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
            }
        });
        function search() {
            if (CheckValues()) {
                $("#hFyear").val(Fyear.GetText());
                $("#hFmon").val(Fmon.GetText());
                $("#content").attr("src", rootPath + '/QueryTB/QueryTBSummarySheet?Year=' + Fyear.GetText() + '&Mon=' + Fmon.GetText());
            }
        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnSave":
                    {
                        if ($("#hFyear").val() == "" | $("#hFyear").val() == null | $("#hFmon").val() == "" | $("#hFmon").val() == null) {
                            alert('请选择正确的年度或月份');
                        } else {
                            form1.submit();
                        }
                        break;
                    }
                case "btnReport":
                    {



                        document.frames["content"].focus();
                        document.frames["content"].print();

                        break;


                    }


            }
        }
        function Editqy() {
            $("#popContent1").attr("src", rootPath + "/Key_NSRXX/Index?report=1");
            codeModalMode1.Show();
        }
        function codeCancel1() {
            codeModalMode1.Hide();
        }
        function CheckValues() {
            if (Fyear.GetText() == null | Fyear.GetText() == "") {
                alert('请选择正确的年度');
                return false;
            }

            if (isNaN(Fyear.GetText())) {
                alert('请选择正确的年度');
                return false;
            }
            if (Fmon.GetText() == null | Fmon.GetText() == "") {
                alert('请选择正确的月份');
                return false;
            }
            return true;
        }
        function keyPress() {
            if (event.keyCode && event.keyCode == 13) {
                search();
            }
        }
        function undo() {
           
            Fyear.SetText("");
            Fmon.SetText("");
           
        }
    </script>
</head>
<body onkeypress="keyPress()">
    @using (Html.BeginForm("ToExecl", "QueryTB", FormMethod.Post, new { id = "form1" }))
    {
     
        @Html.Hidden("hFyear", "");
        @Html.Hidden("hFmon", "");
        @Html.Hidden("e", ViewData["e"])
  
        @Html.DevExpress().Menu(settings =>
{
    settings.Name = "toolBarMenu";
    settings.ItemAutoWidth = false;
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
    settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
    settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
    settings.Items.Add(item =>
    {
        item.Name = "btnSave";
        item.Text = "导出Excel";
        item.Image.Url = Url.Content("~/Content/ControlImages/import.png");
    });

    settings.Items.Add(item =>
    {
        item.Name = "btnReport";
        item.Text = "打印";
        item.Image.Url = Url.Content("~/Content/icons/print.png");
    });

    settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
    settings.ItemLinkMode = ItemLinkMode.ContentBounds;
}).GetHtml()
        <div>
            <table width="100%">
                <tr>
                    <td align="center">
                        <table>
                            <tr>
                                <td align="right" style="text-align: right">
                                    年度：
                                </td>
                                <td align="right" style="text-align: right">
                                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "Fyear";

                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(120);

               }).GetHtml()
                                </td>
                                <td align="right" style="text-align: right">
                                    月份：
                                </td>
                                <td align="right" style="text-align: right">
                                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "Fmon";

                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(120);

               }).GetHtml()
                                </td>
                                <td>
                                    @Html.DevExpress().Button(settings =>
{
    settings.Name = "btnrpt";
    settings.Text = "编辑企业";
    settings.ControlStyle.CssClass = "button";
    settings.Images.Image.Url = Url.Content("~/Content/FunctionImages/SpecificAdjustManage.png");
    settings.ClientSideEvents.Click = "Editqy";
}).GetHtml()
                                </td>
                                <td>
                                    @Html.DevExpress().Button(settings =>
{
    settings.Name = "btnSearch";
    settings.Text = "查询";
    settings.ControlStyle.CssClass = "button";
    settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
    settings.ClientSideEvents.Click = "search";
}).GetHtml()
                                </td>
                                <td>
                                    @Html.DevExpress().Button(settings =>
               {
                   settings.Name = "btnUndo";
                   settings.Text = "重置";
                   settings.ControlStyle.CssClass = "button";
                   settings.Images.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
                   settings.ClientSideEvents.Click = "undo";
               }).GetHtml()
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <div>
                <iframe id='content' name='content' style='width: 100%; height: 500px' frameborder='0'
                    src=''></iframe>
            </div>
        </div>
        
         
        @Html.DevExpress().PopupControl(
    settings =>
    {
        settings.Name = "codeModalMode1";
        settings.Width = 750;
        settings.Height = 500;
        settings.AllowDragging = true;
        settings.CloseAction = CloseAction.CloseButton;
        settings.EnableAnimation = false;
        settings.HeaderText = "编辑纳税人";
        settings.Modal = true;
        settings.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
        settings.PopupVerticalAlign = PopupVerticalAlign.WindowCenter;
        settings.ShowFooter = true;
        settings.SetFooterTemplateContent(s =>
        {
            ViewContext.Writer.Write("<table align='center'><tr><td>");

            @Html.DevExpress().Button(footBtnSettings =>
            {
                footBtnSettings.Name = "btnCancel1";
                footBtnSettings.Text = "关闭";
                footBtnSettings.ClientSideEvents.Click = "codeCancel1";
                footBtnSettings.Images.Image.Url = Url.Content("~/Content/ControlImages/no.png");
                footBtnSettings.CausesValidation = false;
            }).GetHtml();
            ViewContext.Writer.Write("</td></tr></table>");

        });
        settings.SetContent(() =>
        {
            ViewContext.Writer.Write("<iframe  id='popContent1' name='popContent1' style='width:100%;height:500px' frameborder='0' ></iframe>");
        });
    }).GetHtml()
    }
</body>
</html>
